home *** CD-ROM | disk | FTP | other *** search
- Raytracing fractals with rayshade:
-
- The file rayshade.4.0.6-fractals.tar contains additions and modifications to
- the rayshade.4.0.6 distribution that will enable you to raytrace fractals, more
- specifically:
-
- - fractal mountains ala [Musgrave et al, 1989]
- - general random midpoint subdivision objects ala [Magnenat-Thalmann et al,
- 1987]
- - 3D Iterated Function Systems ala [Barnsley, 1988]
- - 3D Iterated Function Systems with condensation set
- - 3D Hierarchical Iterated Function Systems
- - Oppenheimer trees ala [Oppenheimer, 1986]
-
- This code is tha result of two graduation theses at
- the K.U.Leuven, Leuven, Belgium during the academic year 1992-1993.
- It is offered to anyone who'd like to use it on an as-is basis and
- will probably not be supported by us in future. Use it as you like,
- modify it as you like, but don't complain that it doesn't fit your
- particular purposes. At least the example rayshade scripts in this
- package have been tested and the code worked for these on a variety
- of machines.
-
- ----
-
- Installation:
-
- The rayshade.4.0.6-fractals.tar file unpacks in the rayshade.4.0.6
- directory, as does rayshade.4.0.6.tar. 'cd' to rayshade.4.0 and
- execute 'sh install-patches' and then, if you ran the Configure script
- before, run Reconfigure, and if you didn't, execute that
- one (Configure).
-
- After making it, test your new rayshade on crazy.ray, ferns.ray,
- fractalballs.ray, moon.ray, pyramids.ray, shirt.ray and/or tree.ray
- in the Examples subdirectory of rayshade.4.0. I tested the patches
- on various machines (IBM RS/6000, Sun 4, Dec 3100, IBM PC running Linux)
- and had no problems on these. Anyway, I don't see anything too bizarre in
- the code that might break any more or less standard C compiler too
- seriously.
-
- Don't expect your computer to be ready soon: these are very
- complicated objects and some of them require long preprocessing times.
- Giving rayshade the -S1 and -D1 switches and/or reducing the screen size
- will make it render quite a bit faster (with equally lower image quality).
-
- ---
-
- Fractal object rayshade-format:
-
- (parts between '...' are litteral, parts between [...] optional)
-
-
- 1) fractal mountains:
-
- 'mountain' [surface] x1 x2 y1 y2
- r
- H
- precalculation-level
- max-calculation-level
- scale-factor
- z1 ... zn
-
- with
-
- - surface: a name for a rayshade surface description
- - x1 x2 y1 y2: coordinates of the mountains base plane
- - r: a random seed number
- - H: for a fractal dimension D = 3-H, eg 0.8 for D=2.2 (looks nice)
- - precalculation-level: the level to which the mountain has to be
- precalculated, that is, worked out before starting the raytracing
- itself. The higher this number, the faster the raytracing, but
- the more memory is needed.
- - max-calculation-level: to which recursion level the mountain has to be
- calculated: precalculation-level <= max-calculation-level
- - scale-factor: a scale factor to be applied to all random displacements
- (controls the raggedness of the mountain)
- - z1 ... zn: a square matrix of initial height values.
-
- See rayshade.4.0/Example/mountain.ray for an example and [Musgrave et all,
- 1989] for details.
-
-
- 2) general random midpoint displacement objects:
-
- 'fractalobject' [surface] r dim max excentricity
- 'fpoints' x1 y1 z1 ... xn yn zn
- 'ftriangles' p11 p12 p13 ... pm1 pm2 pm3
- 'fentities'
- 'fentity' dx dy dz t1 ... tk
- ...
- 'fentity' dx dy dz t1 ... tk
-
- with
-
- - r: a random seed number
- - dim: fractal dimension
- - max: maximum length of a side of a triangle
- - excentricity: scalefactor by which all random displacements are multiplied
- - fpoints: followed by a list of triangle vertices
- - ftriangle: followed by a list of triangles describing the object to
- be deformed. each triangle is given by the indices of three
- points in the list of vertices
- - fentities: starts a list of subobject-descriptions. Dividing an object in
- subobjects speeds up the rendering.
- - fentity: starts the description of a subobject
- - dx dy dz: in how many parts the bounding box of the subobject has to be
- split.
- - t1 ... tk: a list of triangles (given by index in the triangle list) that
- belong to this subobject.
-
- More information can be found in [Magnenat-Thalmann et al, 1987]. crazy.ray
- and shirt.ray are example scripts for this class of objects.
-
-
- 3) Iterated Function Systems
-
- 'ifs' [condensation-set','] [leaf','] IFS-transformations [options] 'end'
-
- with
-
- - condensation-set: for an IFS with condensation set or Oppenheimer tree: can
- be any object that rayshade accepts for rendering (including another
- IFS or Oppenheimer tree ...)
- - leaf: for an Oppenheimer tree the condensation set describes the geometry
- of a branch and this rayshade object describes the geometry for
- a leaf. Can also be any object rayshade can render.
- - IFS-transformations: IFS-transformation [','IFS-transformations]
- - IFS-transformation: [priority] transformation
- - priority: rang of the transformation in a hierarchical IFS
- - transformation: a rayshade transformation or comsposition of transformations.
- - options:
- - 'normalweighting' {'highpass'|'lowpass'|'constant'}: controls
- the way normals are constructed on the attractor of a
- plain IFS or HIFS without condensation ala [Hart and
- Defanti, 1991]. Just try it out.
- - 'maxdepth' depth: to which level of recursion the attractor of
- an IFS has to be worked out
- - 'minsize' size: don't go subdividing objects that are smaller than
- this size (also controls the recursion depth, but adaptively).
- - 'bounding' {'box'|'sphere'}: use a box or a sphere as bounding
- volume. The code tries to choose the best one by
- comparing the average projected area of the smallest
- possible box and sphere.
- - 'list' filename: produce a list of volumes that will be
- rendered in the file with given name. After some editing
- this list can be used as input for rayshade for using
- a grid for faster rendering (in some cases it is just much
- faster to give rayshade a list of objects in a grid instead
- of using the general ray-IFS intersection routines)
-
- The implementation is based on [Hart and Defanti, 1991]. See
-
- - pyramids.ray: for an example of a plain IFS
- - fractalballs.ray: Eric haines' sphereflake is an IFS with condensation set
- - ferns.ray: Barnsley's fern leaf is a hierarchical IFS
- - tree.ray: simple example of an Oppenheimer tree
-
- ----
-
- References:
-
- - [Barnsley, 1988] M. Barnsley, 'fractals everywhere', Academic Press inc.,
- 1988
- - [Hart and Defanti, 1991] J. C. Hart and Th. Defanti, 'Efficient antialiased
- raytracing of 3D linear fractals', Computer Graphics, 25(4):91,
- july 1991
- - [Magnenat-Thalmann et al, 1987] N. Magnenat-Thalmann, L. Forest, M. Burges,
- and D. Thalmann, 'A geometric study of parameters for recursive
- midpoint subdivision', The Visual Computer, 3:145-151, 1987
- - [Musgrave et al, 1988] F. K. Musgrave, C. E. Kolb(!), and R. S. Mace,
- 'The synthesis and rendering of eroded fractal terrains', Computer
- Graphics, 23(3):41-50, 1989
- - [Oppenheimer, 1986] P. E. Oppenheimer, 'real time desing and animation
- of fractal plants and trees', Computer Graphics, 20(4):55-61, 1986
-
- ----
-
- The fractal mountains and general random midpoint subdivision objects
- were done by Peter Janssen, the IFS objects by Philippe Bekaert, in
- the computer graphics research group of the dpt. of computer science
- of the K.U.Leuven, Leuven, Belgium.
-
- Send e-mail to
-
- philippe@cs.kuleuven.ac.be
-
- for questions, bug-reports, comments ... although we do not intend to really
- support this code in future, as stated before.
-
-
-